﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using OrganizedIN.BAL;
using OrganizedIN.BussinessServices;

namespace OrganizedIN.UI.AccountSetting
{
    public partial class LanguageSetting : System.Web.UI.Page
    {
        BLL oibll = new BLL();
        LanguageSet objlangSet = new LanguageSet();
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    DataSet dslang = oibll.language_Name(objlangSet);
                    if (dslang.Tables[0].Rows.Count > 0)
                    {
                        DropDownList1.DataSource = dslang.Tables[0];
                        DropDownList1.DataTextField = "Lang_Name";
                        DropDownList1.DataValueField = "Lang_id";
                        DropDownList1.DataBind();
                        DropDownList1.Visible = true;
                        //DropDownList1.Items.Insert(0, new ListItem("Select", "Select", true));
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
        protected void btnsubmit_Click(object sender, EventArgs e)
        {
          try{
            //LanguageSet objlangSet = new LanguageSet();
            if (txtlanguage.Text.Trim() != "")
            {
                objlangSet.language = txtlanguage.Text;
                objlangSet.Primary_language = DropDownList1.Text.Trim();               
                objlangSet.Fromdate = DateTime.Now;
                objlangSet.user_name = Session["UserID"].ToString();
                oibll.LanguageSettingInsert(objlangSet);
                txtlanguage.Text = "";
                lblerrmsg.Text = "Insert Successfully..";
            }
          }
          catch (Exception ex)
          {
          }
        }
    }
}
